package com.h.forum.common.utils;

import com.h.forum.pojo.model.User;
import com.h.forum.pojo.response.UserInfoResponse;
import org.springframework.beans.BeanUtils;

public class BeanTransUnits {
    public static UserInfoResponse trans(User user) {
        if (user == null) {
            return null;
        }
        UserInfoResponse userInfoResponse = new UserInfoResponse();
        BeanUtils.copyProperties(user, userInfoResponse);
        return userInfoResponse;
    }
}
